package server;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

import client.Item;
import client.Player;

public class Game {
	
	private int numPlayer;
	private ArrayList<Player> players;
	private ArrayList<Integer> cards = new ArrayList<Integer>(Arrays.asList(0,0,0,1,1,1,2,3,4,5,6,7,8,9,10,11,12,13));
	//
	private int forbid = 4; 
	//
	
	public Game(int numPlayer, ArrayList<Player> players) {
		
		ArrayList<Integer> deal = new ArrayList<Integer>(Arrays.asList(14,15));
		int temp;
		
		this.numPlayer = numPlayer;
		this.players = players;
		
		for (int i = 2; i < numPlayer; i++) { 
			temp=(int) (Math.random()*(20-i-forbid));
			deal.add(cards.get(temp));
			cards.remove(temp);
		}
		
		for (int i = 0; i < numPlayer; i++) { 
			temp=(int) (Math.random()*(numPlayer-i));
			(players.get(i)).getcard(deal.get(temp));
			deal.remove(temp);
		}
		
	}
	

	
	
	

}
